



const timer = new Promise((resolve, reject) => {
  setTimeout(()=>{
    resolve({res: 'run timer success'})
  }, 3000)

});

async function callTimer(){

  const result = await timer
  // result是 {res: 'run timer success'}
  // console.log('result:', result)
}


async function testAsync(){
  const result = await callTimer()
  // result是空的
  console.log('result:', result)
  
}

testAsync()


function test01(){
  timer.then((result)=>{
    console.log('call timer')
    console.log('result:', result)
  })
}





